package com.black.apartment.controller.address;

import com.black.apartment.domain.Area;
import com.black.apartment.service.IAreaService;
import com.black.common.core.controller.BaseController;
import com.black.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.annotation.Resources;
import java.util.List;

@RestController
@RequestMapping("/address")
public class AddressController extends BaseController {
    @Resource
    private IAreaService areaService;

    @RequestMapping("/getAddress")
    public AjaxResult getAddress(
            @RequestParam(required = false) Integer areaId,
            @RequestParam(required = false) Byte areaType
    ){
        List<Area> address = areaService.getAddress(areaId, areaType);
        return AjaxResult.success(address);
    }
}
